history (Unix)

The various Unix shells maintain a record of the commands issued by the user during the current session. The history command manipulates this history list. In its simplest form, it prints the history list. Options allow for the recall and editing of particular commands and for setting parameters such as the number of past commands to retain in the list.

In early versions of Unix the history command was a separate program. However, most shells have long included the history command as a shell built-in, so the separate program is no longer in common use. Since most current history commands are shell built-ins, details depend on the choice of shell.